import '@manycore/miniapp-sdk';

type IPlank = Awaited<
  ReturnType<typeof Manycore.Integration.Bom.getPlankListAsync>
>['result'][0];

type Profile = IPlank['finishedProfile'];

type HoleOrGroovePropsKey = 'plankFaceId' | 'start' | 'end' | 'depth';

// type _Hole = IPlank['holes'][0];
// TODO: miniapp-sdk 类型修正时删除 --->
type _Hole_0 = IPlank['holes'][0];
type PlankFaceId = string | number;
type _Hole_1 = Omit<_Hole_0, 'plankFaceId'> & { plankFaceId: PlankFaceId };
type _Hole = _Hole_1;
// <---
type Hole = Pick<_Hole, 'holeId' | HoleOrGroovePropsKey>;

// type _Groove = IPlank['grooves'][0];
// TODO: miniapp-sdk 类型修正时删除 --->
type _Groove_0 = IPlank['grooves'][0];
type _Groove_1 = Omit<_Groove_0, 'plankFaceId'> & { plankFaceId: PlankFaceId };
type _Groove = _Groove_1;
// <---

type Groove = Pick<_Groove, 'grooveId' | HoleOrGroovePropsKey>;

interface HightLight {
  holes: string[];
  grooves: string[];
}

export interface IPlankProps {
  profile?: Profile | null;
  inners?: Profile[];
  width: number;
  height: number;
  holes: Hole[];
  grooves: Groove[];
  thickness: number;
  hightLight: HightLight;
  edgeBanding: number[];
  texture: string;
}
